package com.zt.bigdata.vertx.service

import com.ecfront.dew.common.Resp
import com.typesafe.scalalogging.LazyLogging
import com.zt.bigdata.vertx.interceptor.{Animal, ProcessFunction}
import io.vertx.ext.web.RoutingContext
import org.springframework.stereotype.Service

import scala.concurrent.Promise

/**
  *
  */
@Service
class AHandler extends ProcessFunction[Animal, String] with LazyLogging {
  override def process(routingContext: RoutingContext, e: Animal, future: Promise[Resp[String]]): Unit = {
    logger.info("Handler")
    e.speak()
    future.success(Resp.success("ok"))
  }
}
